package com.micangcaihang.micang.mvp.task.model;

import com.micangcaihang.common.baserx.RxSchedulers;
import com.micangcaihang.common.http.ApiResult;
import com.micangcaihang.common.http.RxHelper;
import com.micangcaihang.micang.entity.CommentaryExamineEntity;
import com.micangcaihang.micang.http.FApiService;
import com.micangcaihang.micang.mvp.task.contract.ExamineCommentaryContract;

import io.reactivex.Observable;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/8/14
 *     update : 2017/8/14
 *     desc   : 调评审查
 *     version: 1.0
 * </pre>
 */
public class ExamineCommentaryModel implements ExamineCommentaryContract.Model {
    /**
     * 调评审查资料
     *
     * @param id
     * @return
     */
    @Override
    public Observable<ApiResult<CommentaryExamineEntity>> getExamineCommentaryData(String id) {
        return FApiService.<ApiResult<CommentaryExamineEntity>>biz_invest(id)
                .compose(RxSchedulers.observableIoToMain())
                .compose(RxHelper.handleResult());
    }
}
